<?php

namespace Unl\HomologacionBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class UnidadRegistroType extends AbstractType
{
    private $ocultar=FALSE;
    public function setOcultar($ocultar) {
        $this->ocultar = $ocultar;
    }
    
    public function buildForm(FormBuilder $builder, array $options)
    {
        if ($this->ocultar == TRUE ) {
            $builder
                        
            ->add('modulo','text',array('read_only' =>'true'))  
            ->add('nombre','text',array('read_only' =>'true'))
            ->add('numeroHoras','text',array('read_only' =>'true'))
            ->add('numeroCreditos','text',array('read_only' =>'true'))  
        ;
        }
        
        if ($this->ocultar == FALSE ) {
          $builder
            
            ->add('modulo')   
            ->add('nombre')
            ->add('numeroHoras')
            ->add('numeroCreditos')  
        ;  
        }
        
    }

     public function getDefaultOptions(array $options)
    {
        return array('data_class' => 'Unl\HomologacionBundle\Entity\Unidad',);
    }
    
    public function getName()
    {
        return 'unl_homologacionbundle_unidadregistrotype';
    }
}
